// 创建路由

import VueRouter from 'vue-router';
import About from '../pages/About.vue';
import Home from '../pages/Home.vue';
import News from '../pages/News.vue';
import Messages from '../pages/Messages.vue';
import Detail from '../pages/Detail.vue';

export default new VueRouter({
    routes: [
        {
            name: 'aboutName',
            path: '/about',
            component: About
        },
        {
            path: '/home',
            component: Home,
            children:[
                {
                    path: 'news',
                    component: News
                },
                {
                    path: 'messages',
                    component: Messages,
                    children:[
                        {
                            name: 'detailName',
                            path: 'detail/:id/:title',
                            component: Detail
                        }
                    ]
                },
            ]
        },
        
    ]
});
